package com.leetroll.api.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.leetroll.api.mapper.CategoryMapper;
import com.leetroll.api.service.CategoryService;
import com.leetroll.common.entity.Category;
import org.springframework.stereotype.Service;

@Service
public class CategoryServiceImpl extends SuperServiceImpl<CategoryMapper, Category> implements CategoryService {

    @Override
    public Category getByName(String cat) {
        QueryWrapper<Category> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("name", cat);
        return super.getOne(queryWrapper);
    }
}
